﻿    CREATE TABLE public.resource
	(
	    /***************************************************************************************************
	    **  Table:	    public.resource
	    **  Author:		Zhixian Ong
	    **
	    **  Description:
	    **    
	    **    Represents a settings for an existing resource.
	    **    username and password represents the credentions needed to access the resource.
	    **    ip and path are use for network resources
	    **    
	    **
	    **  Fields (6):
	    **
	    **      id              - resource id
	    **      name            - name
        **      alias           - alias
        **      resource_type_id- resource_type_id
        **      ip              - ip
        **      path            - path
	    **      
	    **
	    **  Constaints (2):
	    **
	    **      resource_pk  - 
	    **      resource_uc  - 
	    **      
	    **
	    **  Modification History:
	    **
	    **      20140102  Zhixian Ong     - Initial prototype
	    ** 
	    **  Status:
	    **      Not in use
	    ** 
	    ***************************************************************************************************/
        
	    -- [Fields]
	    id              integer                 NOT NULL DEFAULT nextval('resource_id_seq'),
	    name            character varying(128)  NOT NULL, 
        alias           character varying(128)  NULL,
        resource_type_id integer                NULL,
        
        ip              character varying(45)   NULL,
        path            character varying(260)  NULL,
        
	    -- [Constraints]
	    CONSTRAINT resource_pk   PRIMARY KEY ("id"),
	    CONSTRAINT resource_uc   UNIQUE ("name")
	);